package cn.edu.zafu.bigdata.lyq.work5;

public class TestCube {
    public static void main(String[] args) {
        // 创建Cube对象
        Cube cube1 = new Cube(3.0, 3.0, 3.0);
        Cube cube2 = new Cube(3.0, 3.0, 3.0);
        Cube cube3 = new Cube(4.0, 4.0, 4.0);

        // 测试相等性
        System.out.println("cube1 equals cube2: " + cube1.equals(cube2)); // 应输出true
        System.out.println("cube1 equals cube3: " + cube1.equals(cube3)); // 应输出false

        // 测试自身相等性
        System.out.println("cube1 equals itself: " + cube1.equals(cube1)); // 应输出true

        // 测试与null的相等性
        System.out.println("cube1 equals null: " + cube1.equals(null)); // 应输出false

        // 测试与不同类型对象的相等性
        String notACube = "I am not a cube";
        System.out.println("cube1 equals notACube: " + cube1.equals(notACube)); // 应输出false
    }
}
